import Vue from 'vue'
import VueRouter from 'vue-router'
import elementUi from 'element-ui'

Vue.use(elementUi)
Vue.use(VueRouter)

const router = new VueRouter({
	routes: [
		{
			path: '/',
			name: 'Index',
			component: resolve => require(['../pages/index.vue'], resolve),
		}, {
			path: '/Index',
			name: 'Index',
			component: resolve => require(['../pages/index.vue'], resolve),
		}, {
			path: '/Login',
			name: 'Login',
			component: resolve => require(['../pages/login.vue'], resolve),
		}, {
			path: '/Archive',
			name: 'Archive',
			component: resolve => require(['../pages/archive.vue'], resolve),
		}, {
			path: '/Label',
			name: 'Label',
			component: resolve => require(['../pages/label.vue'], resolve),
		}, {
			path: '/ArrayItem',
			name: 'ArrayItem',
			component: resolve => require(['../pages/arrayItem.vue'], resolve),
		}, {
			path: '/Classify',
			name: 'Classify',
			component: resolve => require(['../pages/classify.vue'], resolve),
		}, {
			path: '/About',
			name: 'About',
			component: resolve => require(['../pages/about.vue'], resolve),
		}, {
			path: '/Friend',
			name: 'Friend',
			component: resolve => require(['../pages/friend.vue'], resolve),
		}, {
			path: '/Article',
			name: 'Article',
			component: resolve => require(['../pages/article.vue'], resolve),
		},
		{
			path: '/Backindex',
			name: 'Backindex',
			component: resolve => require(['../pages/back/index.vue'], resolve),
			meta: {
				requireLogin: true, // 需要登录才能进入的页面可以增加一个meta属性
			}
		},
		{
			path: '/addArticle',
			name: 'addArticle',
			component: resolve => require(['../pages/back/addArticle.vue'], resolve),
			meta: {requireLogin: true, }
		},
		{
			path: '/articleList',
			name: 'articleList',
			component: resolve => require(['../pages/back/articleList.vue'], resolve),
			meta: {requireLogin: true, }
		},
		{
			path: '/friendList',
			name: 'friendList',
			component: resolve => require(['../pages/back/friendList.vue'], resolve),
			meta: {requireLogin: true, }
		},
		{
			path: '/userList',
			name: 'userList',
			component: resolve => require(['../pages/back/userList.vue'], resolve),
			meta: {requireLogin: true, }
		},
	],
})
export default router
